import { getToken } from '@/utils/myAuth'

export default {
  data() {
    return {
      pagination: {
        limit: 10, // 一页多少条数据
        start: 1, // 获取第几页数据
        total: 0, // 一共多少条数据
        sizes: [10, 20, 30]
      },
      uploadImageUrl: '/lejuAdmin/material/uploadFileOss', // 图片上传接口
      passForm: false, // 是否传递表单搜索项目
      status: [// 订单状态
        {
          label: 0,
          desc: '待付款',
          type: 'danger',
          plain: false
        },
        {
          label: 1,
          desc: '待发货',
          type: 'warning',
          plain: false
        },
        {
          label: 2,
          desc: '已发货',
          type: 'primary',
          plain: true
        },
        {
          label: 3,
          desc: '已完成',
          type: 'success',
          plain: false
        },
        {
          label: 4,
          desc: '退货',
          type: 'info',
          plain: false
        },
        {
          label: 5,
          desc: '无效订单',
          type: 'info',
          plain: true
        }
      ],
      returnStatus: [// 退单状态0->待处理；1->退货中；2->已完成；3->已拒绝
        {
          label: 0,
          desc: '待处理',
          type: 'danger',
          plain: false
        },
        {
          label: 1,
          desc: '退货中',
          type: 'warning',
          plain: false
        },
        {
          label: 2,
          desc: '已完成',
          type: 'primary',
          plain: true
        },
        {
          label: 3,
          desc: '已拒绝',
          type: 'info',
          plain: true
        }
      ],
      sku: [
        {
          type: 'color',
          name: '颜色',
          example: '土豪金',
          input: '',
          selectedArr: [],
          arr: []
        },
        {
          type: 'size',
          name: '大小',
          input: '',
          example: '128g',
          selectedArr: [],
          arr: []
        }
      ]
    }
  },
  computed: {
    token() {
      return {
        token: getToken()
      }
    }
  },
  methods: {
    filterNullParamsObject(obj) {
      this.passForm = false
      var paramsArr = Object.keys(obj)
      for (var i = 0; i < paramsArr.length; i++) {
        if (obj[paramsArr[i]] !== undefined && obj[paramsArr[i]] !== '') {
          this.passForm = true
          break
        }
      }
    }
  }
}
